<template>
  <div class="nav">
    <div class="logo">
      <!-- 更改项目logo文件路径 -->
      <img
        src="https://pic4.zhimg.com/v2-77b1a31dc62d9e00abd0ea6cdaba5c83_xl.jpg"
      />
      <!-- 更改项目标题 -->
       <transition name="el-zoom-in-center">
        <span v-show="iconFlag">xiao-chu-ju</span>
      </transition>
      <div class="opera" @click="toggleAside">
        <!-- 控制菜单显示隐藏 -->
        <i class="el-icon-s-fold" v-if="iconFlag"></i>
        <i class="el-icon-s-unfold" v-else></i>
      </div>
    </div>
    <div class="search"></div>
    <div class="user">
      <div class="userInfo">
        <img
          src="https://pic4.zhimg.com/v2-77b1a31dc62d9e00abd0ea6cdaba5c83_xl.jpg"
        />
        <span>您好!{{ userId }}</span>
      </div>
      <div>
        
        <span><i class="el-icon-remove-outline"></i>退出登录</span>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      userId: "管理员",
      iconFlag:"true"
    };
  },
  name: "navTop",
  components: {},
  methods:{
    toggleAside(){
      this.iconFlag=!this.iconFlag
      this.$emit('toggleAside')
    }
  }
};
</script>

<style lang='scss' scoped>
.nav {
  width: 100vw;
  height: 60px;
  background-color:$mainColor;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .logo {
    display: flex;
    justify-content:start;
    align-items: center;
    width: 250px;
    img {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      margin-right:10px ;
      margin-left: 12px;
    }
    span {
      min-width: 110px;
      font-size: 20px;
      color: #ffffff;
      line-height: 50px;
    }
    .opera {
      width: 50px;
      height: 50px;
      text-align: center;
      line-height: 50px;
      i {
        width: 20px;
        height: 20px;
        color: #ffffff;
      }
    }
    .opera:hover {
      background-color: rgba(255,255,255,0.5);
      cursor: pointer;
    }
  }
  .search {
    width: 400px;
    height: 50px;

  }
  .user {
    width: 250px;
    height: 50px;
    margin-right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 50px;
    .userInfo {
      text-align: center;
      width: 150px;
      display: flex;
      align-items: center;
      img {
        width: 30px;
        height: 30px;
        margin-right: 8px;
      }
    }
    div:hover{
      background-color: rgba(255,255,255,0.5);
      cursor: pointer;
    }
    div {
      text-align: center;
      width: 100px;
      span {
        color: #ffffff;
      }
    }
  }
}
</style>